-- @Author: 作者QQ2308873645
-- @Date:   2021-11-27 13:12:32
-- @Last Modified by:   作者QQ381990860
-- @Last Modified time: 2022-07-23 06:58:48
local 场景类_成就 = class(窗口逻辑)
local insert = table.insert
local remove = table.remove
local floor = math.floor
local tp,zts,zts1
function 场景类_成就:初始化(根)
    self.ID = 315
    self.x = 90+(全局游戏宽度-800)/2
    self.y = 65
    self.xx = 0
    self.yy = 0
    self.注释 = "成就"
    tp = 根
        self.鼠标 = false
    self.焦点 = false
    self.可移动 = true
    local 按钮 = 根._按钮
    local 自适应 = 根._自适应
    local  资源= 根.资源
    self.资源组 = {
        [1] = 自适应.创建(0,1,700,450,3,9),

        --[2] = 按钮.创建(资源:载入('新关闭按钮',"动画"),0,0,4,true,true),
        [3]=按钮.创建(自适应.创建(11,4,75,20,1,3),0,0,4,true,true,"光武拓印"),
        [4]=按钮.创建(自适应.创建(11,4,75,20,1,3),0,0,4,true,true,"改变双加"),
        [5]=按钮.创建(自适应.创建(11,4,75,20,1,3),0,0,4,true,true,"捐献仙玉"),
        [6]=按钮.创建(自适应.创建(11,4,75,20,1,3),0,0,4,true,true,"首服奖励"),
        [20] = tp._自适应(5,1,570,240,3,9),
        [21]=资源:载入('7A47CB79',"动画").精灵,
        [22]=资源:载入('FE277252',"动画").精灵,
    }


    for i=3,6 do
      self.资源组[i]:绑定窗口_(315)

    end
    self.装饰 =资源:载入('JM.dll',"网易WDF动画",0x891CA42C)


    self.翻页 =false
    self.窗口时间 = 0
    zts1 = tp.字体表.华康字体

end

function 场景类_成就:刷新信息(内容)
    self.捐献数据=内容
end


function 场景类_成就:打开(内容)
  if self.可视 then
        self.可视 = false
  else

        if  self.x > 全局游戏宽度 then
        self.x = 82+(全局游戏宽度-800)/2
        end
        self.捐献数据=内容
        insert(tp.窗口_,self)
        tp.运行时间 = tp.运行时间 + 1
        self.窗口时间 = tp.运行时间
        self.可视 = true
  end
 end
function 场景类_成就:显示(dt,x,y)
    self.焦点 = false

    self.资源组[1]:显示(self.x,self.y)
 tp.窗口标题背景_:显示(self.x+self.资源组[1].宽度/2-70,self.y+0)
    zts1:置颜色(0xFFFFFFFF):显示(self.x+302,self.y+2,"仙 玉 捐 献")
    --self.资源组[2]:显示(self.x+620,self.y+20,true,1)
   self.资源组[3]:显示(self.x+63,self.y+335,true,1)
    self.资源组[4]:显示(self.x+153,self.y+335,true,1)
    self.资源组[5]:显示(self.x+243,self.y+335,true,1)
    --self.资源组[6]:显示(self.x+243+90,self.y+335,true,1)
    self.资源组[20]:显示(self.x+71,self.y+89,true,1)
    self.资源组[21]:显示(self.x+204,self.y+57)
    -- self.资源组[41]:置区域(0,0,min(floor(self.数据.当前经验 / self.数据.升级经验 * 161),161),self.资源组[41].高度)
    self.资源组[22]:显示(self.x+209,self.y+61)
    self.装饰:更新()
    self.装饰:显示(self.x + 73,self.y + 130)
    self.装饰:显示(self.x + 73,self.y + 170)
    self.装饰:显示(self.x + 73,self.y + 210)
    self.装饰:显示(self.x + 73,self.y + 250)
    self.装饰:显示(self.x + 73,self.y + 290)
    zts1:置颜色(0xFFFFFFFF):显示(self.x+342,self.y+329,"当前全服累计捐献:"..self.捐献数据.累计)
    zts1:置颜色(0xFFFFFFFF):显示(self.x+342,self.y+349,"您当前捐献仙玉数额为:"..self.捐献数据.数额)
    if self.捐献数据.第一名 == nil then
      zts1:置颜色(0xFFa11511):显示(self.x+85,self.y+105,"幸运儿：")
    else
      zts1:置颜色(0xFFa11511):显示(self.x+85,self.y+105,"幸运儿：")
      zts1:置颜色(0xFFff00ff):显示(self.x+145,self.y+105,self.捐献数据.第一名)
    end
    if self.捐献数据.第二名 == nil then
      zts1:置颜色(0xFFeff7ce):显示(self.x+85,self.y+145,"幸运儿：")
    else
      zts1:置颜色(0xFFeff7ce):显示(self.x+85,self.y+145,"幸运儿：")
      zts1:置颜色(0xFFff00ff):显示(self.x+145,self.y+145,self.捐献数据.第二名)
    end
    if self.捐献数据.第三名 == nil then
      zts1:置颜色(0xFF284078):显示(self.x+85,self.y+185,"幸运儿：")
    else
      zts1:置颜色(0xFF284078):显示(self.x+85,self.y+185,"幸运儿：")
      zts1:置颜色(0xFFff00ff):显示(self.x+145,self.y+185,self.捐献数据.第三名)
    end
    if self.捐献数据.第四名 == nil then
      zts1:置颜色(0xFFc65108):显示(self.x+85,self.y+225,"幸运儿：")
    else
      zts1:置颜色(0xFFc65108):显示(self.x+85,self.y+225,"幸运儿：")
      zts1:置颜色(0xFFff00ff):显示(self.x+145,self.y+225,self.捐献数据.第四名)
    end
    if self.捐献数据.第五名 == nil then
      zts1:置颜色(0xFF8c3829):显示(self.x+85,self.y+265,"幸运儿：")
    else
      zts1:置颜色(0xFF8c3829):显示(self.x+85,self.y+265,"幸运儿：")
      zts1:置颜色(0xFFff00ff):显示(self.x+145,self.y+265,self.捐献数据.第五名)
    end
    zts1:置颜色(0xFF0d1c27):显示(self.x+370,self.y+105,"捐献系统奖励如下：")
    zts1:置颜色(0xFF0d1c27):显示(self.x+370,self.y+125,"每个角色只要达到"..self.捐献数据.捐献数额.."仙玉:")
    zts1:置颜色(0xFF0d1c27):显示(self.x+370,self.y+145,"经验提升"..(self.捐献数据.经验加成).."%、气血+"..self.捐献数据.气血加成.."、魔法")
    zts1:置颜色(0xFF0d1c27):显示(self.x+370,self.y+165,"+"..self.捐献数据.魔法加成.."、伤害+"..self.捐献数据.伤害加成.."、法术伤害+"..self.捐献数据.法术伤害加成)
    zts1:置颜色(0xFF0d1c27):显示(self.x+370,self.y+185,"、速度+"..self.捐献数据.速度加成)
    zts1:置颜色(0xFF0d1c27):显示(self.x+370,self.y+205,"捐献数据每周五清空一次")
    zts1:置颜色(0xFF1c6b25):显示(self.x+370,self.y+235,"全服每天中午12点整抽取五名幸")
    zts1:置颜色(0xFF1c6b25):显示(self.x+370,self.y+255,"运儿将获得提升"..(self.捐献数据.额外经验加成).."%经验加成、额")
    zts1:置颜色(0xFF1c6b25):显示(self.x+370,self.y+275,"外伤害+"..self.捐献数据.额外伤害加成.."、法术伤害+"..self.捐献数据.额外法术伤害加成)
    zts1:置颜色(0xFF1c6b25):显示(self.x+370,self.y+295,"、速度+"..self.捐献数据.额外速度加成)

    for i=3,6 do
       self.资源组[i]:更新(x,y)
       if self.资源组[i]:事件判断() then
           if i==2 then 
                self:打开()
           elseif i==3 then
             tp.窗口.光武拓印:打开()

           elseif i==4 then 
           tp.窗口.改变双加:打开() 
           elseif i==5 then 
             tp.窗口.组合输入框:打开("仙玉捐献","请输入你要捐献的仙玉数量")
           elseif i==6 then 
            客户端:发送数据(76,76,76)
           end
       end
    end

end




return 场景类_成就



